package cn.itcast.service.log.impl;

import cn.itcast.dao.log.LogDao;
import cn.itcast.domain.SysLog;
import cn.itcast.service.log.LogService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.UUID;

@Service
public class LogServiceImp implements LogService {
    @Autowired
    private LogDao logDao;
    @Override
    public PageInfo findALLlog(int pageNum, int pageSize,String  companyId) {
        PageHelper.startPage(pageNum,pageSize);
       List<SysLog> list= logDao.findALLlog(companyId);
        PageInfo pageInfo = new PageInfo(list);
        return pageInfo;
    }
    public void saveLog(SysLog log){
        log.setId(UUID.randomUUID().toString());
        logDao.saveLog(log);
    }
}
